package com.garlicts.excel;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


/**
 *	excel导入结果 
 */
public class GarlictsImportResult<T> {

	/**
	 *	excel导入的结果集 
	 */
	private List<T> dataList;

	/**
	 *	excel导入成功的结果集
	 */
	private List<T> successDataList;

	/**
	 *	excel导入失败的结果集
	 */
	private List<T> failDataList;

	/**
	 *	错误信息 
	 *	k=行号 + "_" + 列号, v=错误信息
	 */
	private Map<String, List<String>> errorMap = new ConcurrentHashMap<String, List<String>>();

	/**
	 * 
	 * k=fieldName, v=列的索引值
	 */
	private Map<String, Integer> fieldColumnMap = new HashMap<String, Integer>();
	
	/**
	 *	excel标题行校验结果
	 *	true为校验通过，false为校验失败 
	 */
	private boolean headerRowVerify;
	
	public boolean hasErrorMsg(String key) {
		return errorMap.containsKey(key);
	}

	public List<T> getDataList() {
		return dataList;
	}

	public void setDataList(List<T> dataList) {
		this.dataList = dataList;
	}

	public Map<String, Integer> getFieldColumnMap() {
		return fieldColumnMap;
	}

	public void setFieldColumnMap(Map<String, Integer> fieldColumnMap) {
		this.fieldColumnMap = fieldColumnMap;
	}

	public boolean getHeaderRowVerify() {
		return headerRowVerify;
	}

	public void setHeaderRowVerify(boolean headerRowVerify) {
		this.headerRowVerify = headerRowVerify;
	}

	public Map<String, List<String>> getErrorMap() {
		return errorMap;
	}

	public void setErrorMap(Map<String, List<String>> errorMap) {
		this.errorMap = errorMap;
	}

	public List<T> getSuccessDataList() {
		return successDataList;
	}

	public void setSuccessDataList(List<T> successDataList) {
		this.successDataList = successDataList;
	}

	public List<T> getFailDataList() {
		return failDataList;
	}

	public void setFailDataList(List<T> failDataList) {
		this.failDataList = failDataList;
	}

}
